package cn.hairui.blog.service.impl;

import cn.hairui.blog.model.TabMenu;
import cn.hairui.blog.repository.TabMenuRepository;
import cn.hairui.blog.service.TabMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author lihairui
 * @version V1.0
 * @date: 2019/7/28 19:38
 */
@Service(value = "tabMenuService")
public class TabMenuServiceImpl implements TabMenuService {

    @Autowired
    private TabMenuRepository tabMenuRepository;

    @Override
    public int add(TabMenu tabMenu) {
        return tabMenuRepository.add(tabMenu);
    }

    @Override
    public int update(TabMenu tabMenu) {
        return tabMenuRepository.update(tabMenu);
    }

    @Override
    public int delete(int id) {
        return tabMenuRepository.delete(id);
    }

    @Override
    public TabMenu find(int pk) {
        return tabMenuRepository.find(pk);
    }

    @Override
    public List<TabMenu> list() {
        return tabMenuRepository.list();
    }

    @Override
    public List<Map> listMgr() {
        return tabMenuRepository.listMgr();
    }

    @Override
    public void updateShowFlag(int id, String flag) {
        tabMenuRepository.updateShowFlag(id, flag);
    }

    @Override
    public List<TabMenu> listShow() {
        return tabMenuRepository.listShow();
    }
}
